#include <QMessageBox>
#include "keycapture.h"

KeyCaptureDlg::KeyCaptureDlg(QWidget *parent=0) : QDialog(parent) {
  setupUi(this);
}

QStringList KeyCaptureDlg::keys() { return ks; }
void KeyCaptureDlg::resetKeys() { ks.clear(); }

void KeyCaptureDlg::accept() {
  QString k = keyLineEdit->text();
  if (k.trimmed() == "") {
    // warning
    QMessageBox::warning(this, "EdgyConfigGUI", "The key must be specified.");
    return;
  }
  
  ks.append(k);
  
  QString m1 = m1LineEdit->text();
  if (m1 != "")
    ks.append(m1);
  QString m2 = m2LineEdit->text();
  if (m2 != "")
    ks.append(m2);
  
  QDialog::accept();
}

